package cn.bgw.compare.controller;

import cn.bgw.compare.model.Tradelog;
import cn.bgw.compare.service.TradelogService;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tradelog")
public class TradelogController {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private TradelogService tradelogService;

    @RequestMapping("/getList")
    @ResponseBody
    public Object test() {
        List<Tradelog> list = tradelogService.getList();
        logger.info("{}", JSONObject.toJSONString(list));
        return list;
    }
}
